package org.dreamwork.jasmine2.javac.configuration;

/**
 * Created by IntelliJ IDEA.
 * User: seth
 * Date: 2009-1-21
 * Time: 14:56:38
 */
public class BindingProperty {
    public static final int BIND_TYPE_SIMPLE = 0, BIND_TYPE_LIST = 1;
    private int bindType;
    private String attribute, property;

    public BindingProperty () {}

    public BindingProperty (int bindType, String attribute, String property) {
        this.bindType = bindType;
        this.attribute = attribute;
        this.property = property;
    }

    public int getBindType () {
        return bindType;
    }

    public void setBindType (int bindType) {
        this.bindType = bindType;
    }

    public String getAttribute () {
        return attribute;
    }

    public void setAttribute (String attribute) {
        this.attribute = attribute;
    }

    public String getProperty () {
        return property;
    }

    public void setProperty (String property) {
        this.property = property;
    }

    public boolean equals (Object o) {
        if (this == o) return true;
        if (o == null || getClass () != o.getClass ()) return false;

        BindingProperty that = (BindingProperty) o;

        return bindType == that.bindType && !(attribute != null ? !attribute.equals (that.attribute) : that.attribute != null) && !(property != null ? !property.equals (that.property) : that.property != null);

    }

    public int hashCode () {
        int result = bindType;
        result = 31 * result + (attribute != null ? attribute.hashCode () : 0);
        result = 31 * result + (property != null ? property.hashCode () : 0);
        return result;
    }
}